package com.erp.base.common.utils;

import javax.servlet.http.HttpServletRequest;

import com.erp.base.business.entity.AppUser;
import com.erp.base.common.config.Constant;

/**
 * 
 * @author whw
 *获取ERP官网登录的用户信息
 */
public class AppUserUtils {
	
	public static AppUser getCurrentUser(HttpServletRequest request){
		//AppUser appUser=(AppUser)request.getSession().getAttribute("appUser");
		String token=request.getHeader("token");
		String value = JedisUtils.get(Constant.REDIS_PRIFIX_ERP+token);
		if(value==null){
			return null;
		}
		return JsonMapper.fromJson(value, AppUser.class);
	}
}
